package com.day18me.java;

import java.util.Objects;

public class Employee2 {
            private String name;
            private String gender;
            private int age;

    public Employee2() {
    }

    public Employee2(String name, String gender, int age) {
        this.name = name;
        this.gender = gender;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Employee2{" +
                "姓名“'" + name + '\'' +
                ",性别" + gender + '\'' +
                ", 年纪" + age +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Employee2 employee2 = (Employee2) o;
        return age == employee2.age &&
                name.equals(employee2.name) &&
                gender.equals(employee2.gender);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, gender, age);
    }
}
